

# 交叉编译执行 cmake ./ -DCMAKE_TOOLCHAIN_FILE=cortex_m.cmake

project(at32f403a_daplink C ASM)

file(GLOB_RECURSE sources CONFIGURE_DEPENDS
    firmware/*.c
    firmware/*.C
    bsp/*.c
    user/*.c
    cmsis/*.c
)


message(123)
message(STATUS "${sources}.")

#添加头文件搜索路径
include_directories(
    include
    user/tusb
    user/cmsis-dap
    user/interface
    user/target
    user/
    user/at32f403a
    include/usb
    include/dap_inc
    include/libraries/drivers/inc
    include/libraries/cmsis/cm4/core_support
    include/libraries/cmsis/cm4/device_support
)

add_compile_definitions(
    AT32F403ARCT7
    AT_START_F403A_V1
    CFG_TUSB_DEBUG
    CFG_TUSB_MCU=8800
    USB_EPT_AUTO_MALLOC_BUFFER
    DAPLINK_HIC_ID=0x97969908
    DAPLINK_IF
    TRACE
    OS_USE_TRACE_SEMIHOSTING_DEBUG
    USE_STDPERIPH_DRIVER
)

add_executable(
    main.elf ${sources} ${ASM_SOURCES}
)
